-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core) New tracer API proposal #2430
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 42e2fa8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 38 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@envelop/core |
5.2.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/instruments |
1.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/apollo-datasources |
6.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/apollo-federation |
7.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/apollo-server-errors |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/apollo-tracing |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/auth0 |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/dataloader |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/depth-limit |
6.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/disable-introspection |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/execute-subscription-event |
7.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/extended-validation |
6.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/filter-operation-type |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/fragment-arguments |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/generic-auth |
10.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/graphql-jit |
10.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/graphql-middleware |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/graphql-modules |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/immediate-introspection |
6.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/live-query |
9.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/newrelic |
9.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/on-resolve |
6.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/opentelemetry |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/operation-field-permissions |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/parser-cache |
9.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/persisted-operations |
9.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/preload-assets |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/prometheus |
13.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/rate-limiter |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/resource-limitations |
7.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/response-cache |
8.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/response-cache-cloudflare-kv |
4.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/response-cache-redis |
4.1.6-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/sentry |
14.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/statsd |
7.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/validation-cache |
9.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/testing |
9.0.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
@envelop/types |
5.2.0-alpha-20250227122402-42e2fa806ec3b7c2936e612924b153a20c8662c3 |
npm ↗︎ unpkg ↗︎ |
✅ Benchmark Results
|
💻 Website PreviewThe latest changes are available as preview in: https://4b34eb9f.envelop.pages.dev |
4035aee
to
2ef5e42
Compare
…oga/Hive Gateway
b06ddd5
to
5c5826b
Compare
ad770ba
to
cb5845f
Compare
const instruments = composeInstruments(pluginInstruments) | ||
|
||
const getEnveloped = envelop({ | ||
plugins: [...plugins, { instruments }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the point of this then is to be able to extract the instruments from an existing list of plugins, and then tack them on the end of the plugin list?
This is an interesting workaround and could work. An alternative approach might be to set a priority number on plugins, so that regardless of the order they are defined in, they are executed based on priority. We could then allocate certain ranges for certain things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's closed to the idea yes.
We already have a defined order of plugins execution : It's the order they are defined in the array.
The problem is that, in the case of "wrapping phases", there is often the need to have a different order for "wrapping" and for normal hooks.
So the point of those utils are to extract instruments from plugins (and remove them), so that you can compose them is the order you want. Since you know there is no other instruments, you can put it in the end of the plugin, or at the beginning, it doesn't matter :-)
"typings": "dist/typings/index.d.ts", | ||
"dependencies": { | ||
"@whatwg-node/promise-helpers": "^1.2.1", | ||
"tslib": "^2.5.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isnt this usual a dev and peer dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tslib is imported and used by the JavaScript files compiled by tsc when you have "importHelpers" enabled to dedupe helper methods in the compiled codd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know to be honest, it is like this in other packages so I just copied the same setup ^^'
9412647
to
46ad3d5
Compare
Description
This PR is a proposal for a new API in the core.
The goal is to provide a reliable way of wrapping each phases of the GraphQL pipeline, including plugin hooks.
The main use case aimed by this new API is Observability (Monitoring and Tracing) of the GraphQL server.
Design choices
execute
andsubscribe
phases.Example of usage
Type of change